// JavaScript Document

function expand(id)
	{
		childObj = document.getElementById(id);

		if (childObj.style.display == 'none')
		{
			childObj.style.display = 'block';
		}
		else
		{
			childObj.style.display = 'none';
		}
		return;
	}
function show(id)
	{
		childObj = document.getElementById(id);

		if (childObj.style.display == 'none')
		{
			childObj.style.display = 'block';
		}
		else
		{
			childObj.style.display = 'none';
		}
	return;
	}
	
function display(id)
{
	childObj = document.getElementById(id);
	aerlt(childObj.title);
}	
function show1(id)
	{
		childObj = document.getElementById(id);

		if (childObj.style.display == 'none')
		{
			childObj.style.display = 'block';
		}
		else
		{
			childObj.style.display = 'block';
		}
	return;
	}
function hidden(id)
	{
		childObj = document.getElementById(id);

		if (childObj.style.display == 'block')
		{
			childObj.style.display = 'none';
		}
		else
		{
			childObj.style.display = 'none';
		}
	
	}	
function mouseovershow(id)
 {
	  document.getElementById(id).style.display = "block"; 
 } 
function mouseouthidden(id)
{ 
 	  document.getElementById(id).style.display = "none"; 
}
//字段验证
function dataNotNullValidate(id,result){
	var value = document.getElementById(id).value
	if(value ===null||value ===""){
		document.getElementById(result).innerHTML="<font color=red>不能为空</font>"
	}else
	{
		document.getElementById(result).innerHTML=""
	}
}
//字段验证
function dataNotNullValidate1(id,resultid,result){
	debugger
	var value = document.getElementById(id).value
	if(value ===null||value ===""){
		document.getElementById(resultid).innerHTML="<font color=red>"+result+"不能为空</font>"
	}else
	{
		document.getElementById(resultid).innerHTML=""
	}
}
function dataNotNullValidatefromlogin(mail,password){
		
	var v1 = document.getElementById(mail).value;
	var v2 = document.getElementById(password).value;
	
	if(v1==""||v1==null){
        alert("not null");
	    return false;
    } else if(v2==""||v2==null){
    	alert("not null");
	    return false;
    }
	else
    {
	    return true; 
    }	
}

function dataNotNullValidatefrom(mail,name,p,key){
	
	debugger
	var v1 = document.getElementById(mail).value;
	var v2 = document.getElementById(name).value;
	var v3 = document.getElementById(p).value;
	var v4 = document.getElementById(key).value;
	debugger
	if(v1==""||v1==null){
        alert("not null");
        //debugger
	    return false;
    } else if(v2==""||v2==null){
    	alert("not null");
	    return false;
    }else if(v3==""||v3==null){
    	alert("not null");
	    return false;
	    //debugger
    }else if(v4==""||v4==null){
    	alert("not null");
	    return false;
    }
	else
    {
	    return true; 
    }	
}
///空值提交验证
function dataNotNullValidateForm(formid,submitid,idStr){
	debugger
	var idArray = idStr.split('|');
	for(var i=0;i<idArray.length;i++){
		var id = idArray[i];
		var idvalue = document.getElementById(id).value    ;     
		if(idvalue==""||idvalue==null){
			alert(id+"not null");
			return false; 
		}
	}
	return true
}

//控制搜索方向
function search(form,value,type){
	var form = document.getElementById(form);
	var item = document.getElementById(value);
	if(type=='google'){
		form.action='http://www.google.com.hk/search'
		form.method='get'
		item.name='q'
		form.submit()
	}else if(type=='baidu'){
		form.action='http://www.baidu.com/s'
		form.method='get'
		item.name='wd'
		form.submit()
	}
	else{
		form.submit()
		
	}
	
}

